package com.bruce.tool.map.gaode.web.to;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author 刘正航
 * @version 2021/3/21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddressResult implements Serializable {
    private Integer status;
    private String infocode;
    private Regeocode regeocode;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Regeocode {
        private AddressComponent addressComponent;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AddressComponent {
        private String province;
        private String city;
        private String district;
    }

    public boolean isSucess() {
        return "10000".equals(this.infocode);
    }
}
